<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            outline:1px dotted;
        }
        .out{
            margin:0 auto;
            width:1000px;height:800px;
            position: relative;
        }
        .inner{
            position: absolute;
            width:400px;height:400px;
            left:50%;
            margin-left: -200px;
            top:50%;
            margin-top:-200px;
        }
    </style>
</head>
<body>
    <div class="out">
        <div class="inner"></div>
    </div>
</body>
</html>